
******************************************************
*                   Replication files                *
*         Review of Economics and Statistics         *
*                                                    *
*               Choosing Your Pond                   *
*       Location Choices and Relative Income         *
*                                                    *
*                      Authors:                      *
*       Nicolas Bottan & Ricardo Perez-Truglia       *
*                                                    *
*                   September 2020                   *
*                                                    *
******************************************************


This folder contains replication data and code to generate tables
and figures for the paper.


Organization: Files are arranged into four folders

- Main Experiment: contains dofiles to generate tables and figures for
                   the medical student sample. Note: the survey data on
                   medical students and their residency choices is highly
                   sensitive. Because there is a high risk of disclosing 
                   subject identities, we cannot make this dataset publicly
                   available. The Mturk experiment replicates this experiment
                   closely - as described in the paper.

- Mturk Experiment: contains dofiles and original (anonymized) data file (.dta)
                   for the auxiliary experiment conducted on Amazon Mturk. 

- Ancillary Data: contains ancillary data merged with survey data.

- Results: contains result output files.


Software: Stata/SE 15 (version 15.1) for Mac (macOS Catalina version 10.15.7)


Instructions for replication: In each dofile you must specify the path for the
main folder (under ***Set WD). Uncomment initial code to install required 
packages used throughout. 



List of dofiles (with corresponding folder path)

> Mturk Experiment/01_prepare_data.do
Cleans and prepares data from auxiliary experiment. Generates final data:
mturk_experiment_clean.dta

> Mturk Experiment/02_estimates.do
Estimation code generating results for auxiliary experiment presented
in Appendix Tables B1-B3. 

> Main Experiment/01_mainresults.do
Code generating main results for medical student Experiment.
Generates Tables 1-3.

> Main Experiment/02_appendixtables.do
Code generating results presented in Appendix A Tables.

> Main Experiment/03_figures.do
Code generating main Figures 1-3 and Appendix A Figures.



List of data files (with corresponding path)

> Mturk Experiment/mturk_raw_anonymized.dta
Raw data from auxiliary experiment for sample of US respondents 
from Amazon Mechanical Turks (MTurk). To protect subject confidentiality
we removed PII (worker id, IP addresses, location data). 

> Mturk Experiment/mturk_experiment_clean.dta
Cleaned data for auxiliary experiment generated by 01_prepare_data.do.

> Ancillary data/program_metro_costs.dta
Data on Cost of Living (COL) for metro-areas from the Regional Price Parity
Index and the Cost Of Living Index.

> Ancillary data/program_metro_income.dta
Data to construct Earnings Rankings (ER) at metro-area from the American 
Community Survey and the Current Population Survey.

> Ancillary data/auxiliarydata.dta
Contains data on metro-area characteristics from 2011-2015 American Community
Survey, Quality of Life (Albouy 2016) FBI Uniform Crime Reports, IRS Statistics 
of Income, and 2012 Census of Governments.




Variable list and description for mainexperiment_confidential.dta [not posted for confidenciality]

  obs:         1,080                          
 vars:           127                          16 Oct 2020 12:16
 size:       867,240                          (_dta has notes)
-----------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-----------------------------------------------------------------------------------------
id              int     %9.0g                 Subject ID
university      str39   %39s                  Medical School name
state1          str20   %20s                  Chosen State #1
metro1          str46   %46s                  Chosen City #1
prog1           str92   %92s                  Residency program name city #1
spec1           str37   %37s                  Specialty program city #1
wage1           long    %10.0g                Salary offered at program city #1
state2          str20   %20s                  Chosen State #2
metro2          str46   %46s                  Chosen City #2
prog2           str92   %92s                  Residency program name city #2
spec2           str37   %37s                  Specialty program city #2
wage2           long    %10.0g                Salary offered at program city #2
pre_px1         int     %10.0g                Prior belief COL city #1
pre_px2         int     %10.0g                Prior belief COL city #2
pre_inc1        byte    %10.0g                Prior belief ER city #1
pre_inc2        byte    %10.0g                Prior belief ER city #2
post_px1        int     %10.0g                Posterior belief COL city #1
post_px2        int     %10.0g                Posterior belief COL city #2
post_inc1       byte    %10.0g                Posterior belief ER city #1
post_inc2       byte    %10.0g                Posterior belief ER city #2
age             byte    %10.0g                Age
sourcecol       str6    %9s                   Assigned source: COL
sourceinc       str3    %9s                   Assigned source: ER
valuecol1       str20   %20s                  Assigned value COL city #1
valuecol2       str20   %20s                  Assigned value COL city #2
valueinc1       str4    %9s                   Assigned value ER city #1
valueinc2       str4    %9s                   Assigned value ER city #2
trat            str2    %9s                   Treatments
lr_px1          int     %10.0g                Follow-up prices 1
lr_px2          int     %10.0g                Follow-up prices 2
lr_inc1         byte    %10.0g                Follow-up income rank 1
lr_inc2         byte    %10.0g                Follow-up income rank 2
rank_happiness  byte    %10.0g                Ranking 5 dimensions: Happiness
rank_health     byte    %10.0g                Ranking 5 dimensions: Health
rank_purpose    byte    %10.0g                Ranking 5 dimensions: Purpose in Life
rank_spiritua~y byte    %10.0g                Ranking 5 dimensions: Spirituality
rank_control    byte    %10.0g                Ranking 5 dimensions: Control
growupusa       str3    %9s                   Did you grow up in the US?
eventa          byte    %10.0g                Event A: increase in consumption
eventb          byte    %10.0g                Event B: increase in rank
finishedfollo~p byte    %9.0g                 Completed followup survey (=1)
submitdate      int     %td                   Ranking submission date
finalrank       byte    %9.0g                 Prefers city #1 (=1), Followup
lr_happy        byte    %9.0g                 Follow-up Happiness ranking of programs
baseline_end    int     %td                   Date complete baseline survey
followup_end    int     %td                   Date complete followup survey
gap_baseline    byte    %9.0g                 Days between baseline survey completion and
                                                NRMP deadline
gap_followup    byte    %9.0g                 Days between followup survey completion and
                                                NRMP deadline
male            byte    %9.0g                 Male (=1)
maritalstat     byte    %27.0g     maritalstat
                                              Marital Status
single          byte    %9.0g                 Single (=1)
nkids           byte    %8.0g      nkids      Nr children
attnchk         byte    %9.0g                 Passes attention check (=1)
dualmatch       byte    %9.0g                 Participates in NRMP as dual match (=1)
pre_relpx       float   %9.0g                 Relative COL, Prior
post_relpx      float   %9.0g                 Relative COL, Posterior
lr_relpx        float   %9.0g                 Relative COL, Posterior followup
pre_relinc      float   %9.0g                 Relative ER, Prior
post_relinc     float   %9.0g                 Relative ER, Posterior
lr_relinc       float   %9.0g                 Relative ER, Posterior followup
rank            byte    %9.0g                 Likert score location choice (>4 favors
                                                city #1)
baseline_fina~k byte    %9.0g                 Prefers city #1 (=1), Baseline
happy           byte    %9.0g                 Likert score happier in city #1 (>4 favors
                                                city #1)
po_purpose      float   %9.0g                 Standardized score (POLS adjusted)
                                                subjective perception residency: purpose
po_prestige     float   %9.0g                 Standardized score (POLS adjusted)
                                                subjective perception residency: prestige
po_prospects    float   %9.0g                 Standardized score (POLS adjusted)
                                                subjective perception residency:
                                                prospects
colhat1         float   %9.0g                 COL from COLI city #1
rpphat1         float   %9.0g                 COL from RPP city #1
colhat2         float   %9.0g                 COL from COLI city #2
rpphat2         float   %9.0g                 COL from RPP city #2
inccps1         float   %9.0g                 ER (reported wage) from CPS city #1
incacs1         float   %9.0g                 ER (reported wage) from ACS city #1
inccps2         float   %9.0g                 ER (reported wage) from CPS city #2
incacs2         float   %9.0g                 ER (reported wage) from ACS city #2
z_inccps1       float   %9.0g                 ER ($54,000) from CPS city #1
z_incacs1       float   %9.0g                 ER ($54,000) from ACS city #1
z_inccps2       float   %9.0g                 ER ($54,000) from CPS city #2
z_incacs2       float   %9.0g                 ER ($54,000) from ACS city #2
relpx_true      float   %9.0g                 Relative COL (RPP)
relpx_shown     float   %9.0g                 Relative COL, Shown
relpx_cfact     float   %9.0g                 Relative COL, Alternative
relinc_true     float   %9.0g                 Relative ER (ACS)
relinc_shown    float   %9.0g                 Relative ER, Shown
relinc_cfact    float   %9.0g                 Relative ER, Alternative
lndiffwage      float   %9.0g                 Log(wage1/wage2)
diffwage        float   %9.0g                 Relative salary (in 1000s)
usnewsrank      byte    %10.0g                Medical School ranking according to US News
rel_qol         float   %9.0g                 Relative QOL [Albouy]
rel_res         float   %9.0g                 Relative residency percentile ranking
low_eventa      byte    %9.0g                 Event A<=3
low_eventb      byte    %9.0g                 Event B<=3
low_materialism byte    %9.0g                 Materialism Index<=15
low_competiti~x byte    %9.0g                 Competitive Index<=15
proguniA        byte    %9.0g                 Prog #1 university hospital
proguniB        byte    %9.0g                 Prog #2 university hospital
pop1            long    %12.0g                Total Population city #1 [ACS 2010-2014
                                                msa]
pop2            long    %12.0g                Total Population city #2 [ACS 2010-2014
                                                msa]
lnpop           float   %9.0g                 Log ratio population [ACS 2010-2014 msa]
relblack        float   %9.0g                 Ratio black [ACS 2010-2014 msa]
relhispanic     float   %9.0g                 Ratio Share Hispanic [ACS 2010-2014 msa]
reldens         float   %9.0g                 Ratio population density [ACS 2010-2014
                                                msa]
relforeign      float   %9.0g                 Ratio Share Foreign [ACS 2010-2014 msa]
relrent         float   %9.0g                 Ratio Share Rent [ACS 2010-2014 msa]
relhed          float   %9.0g                 Ratio Share higher ed [ACS 2010-2014 msa]
relgender       float   %9.0g                 Ratio Share male [ACS 2010-2014 msa]
relgini         float   %9.0g                 Ratio ginis [ACS 2010-2014 msa]
relurban        float   %9.0g                 Ratio Share Urban population [ACS 2010-2014
                                                msa]
reldateage      float   %9.0g                 Ratio Pop aged 25-34 [ACS 2010-2014 msa]
lnrelcrime      float   %9.0g                 Log Ratio Crime rate [UCR]
lnrelviolcrime  float   %9.0g                 Log Ratio Violent Crime rate [UCR]
reldemocrat     float   %9.0g                 Relative democrat share
pubgood_total   float   %9.0g                 Log Ratio total local expenditures [Census
                                                of Govts]
pubgood_educ    float   %9.0g                 Log Ratio total local education expenditure
                                                [Census of Govts]
pubgood_health  float   %9.0g                 Log Ratio total local health expenditures
                                                [Census of Govts]
lntaxes         float   %9.0g                 Log federal tax rate ratio
relsaletax      float   %9.0g                 Relative sales tax
perminc         float   %9.0g                 Specialty salary
rel_distu       float   %9.0g                 Relative distance with respect to Medical
                                                School
rel_pqual       float   %9.0g                 Relative city average residency programs
                                                percentile [Doximity]
rel_prog        float   %9.0g                 Ratio number of residency programs in metro
                                                areas
rel_hosp        float   %9.0g                 Ratio number of hospitals in metro areas
rel_mort        float   %9.0g                 Relative city average AMI adjusted 30 day
                                                mortality rate [CMS]
rel_read        float   %9.0g                 Relative city average AMI adjusted 30 day
                                                readmission rate [CMS]
rel_score       float   %9.0g                 Relative city averave overall hospital
                                                score [CMS hospital compare HCAHPS survey
w_incacs1       float   %9.0g                 ER ($54,000) from ACS city #1 including
                                                zero earners
w_incacs2       float   %9.0g                 ER ($54,000) from ACS city #2 including
                                                zero earners
potential       byte    %9.0g                 Tried to select same city for #2 (=1)
-----------------------------------------------------------------------------------------
